package hw875747.lesson1.第一题;

import java.awt.font.NumericShaper.Range;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;

public class Print100 {
	public void method1(){
		for(int i=0;i<101;i++){
			System.out.println(i);
		}
	}
	public int method2(int i){
		if(i<101){
			System.out.println(i);
			i++;
			this.method2(i);
			return i;
		}else {
			return 0;
		}
	}
	public void method3(){
		ArrayList<Integer> a = new ArrayList<Integer>();
		for(int i=1;i<101;i++){
			a.add(i);
		}
//		System.out.println(Arrays.toString(a.toArray()).replace(", ", "\n"));
		System.out.println(Arrays.toString(a.toArray()).substring(1, a.size()-1).replaceAll(",[^0-9]?", "\n"));
	}

	public static void main(String[] args){
		Print100 print = new Print100();
//		print.method1();
		print.method2(1);
//		print.method3();

		
	}
}
